package monsmon.game.stile;

import monsmon.game.Tile;
import monsmon.control.*;
import monsmon.game.*;

/*
 * Is a 'linked' tile, when an ent steps on it, the ent is sent to 
 * 	another location
 *
 */
public class Link_Tile extends Tile{
	
	//////////////////////////////////////////////////////////////////
	//			Fields
	//////////////////////////////////////////////////////////////////

	private int __tx, __ty;
	private String __to_map;

	public Link_Tile(Tile t, int tx, int ty, String to_map){
		super(t.get_x(), t.get_y(), t.get_type());
		__tx = tx;
		__ty = ty;
		__to_map = to_map;
	}

	@Override
	public void walk_on(Entity e){
		MonsGame gm = e.get_lvl().get_game();
		LevelMap to = gm.get_level(__to_map);
		if(to == null) return;
		EControl.ent_move(to, e, __tx, __ty, false);
		gm.msgs.add_msg("You moved to: " + to.lstrs._fname);
	}

}
